package com.hdax.dm.auth.exception;

import com.hdax.dm.utils.CommonResponse;
import com.hdax.dm.utils.ResponseUtil;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BaseExceptionHandler {

    @ExceptionHandler(value = {DmException.class})
    public CommonResponse exceptionHandler(DmException e){
        return ResponseUtil.returnFail(e.getErrorCode(),e.getMessage());
    }
}
